// promise
const promise = new Promise(function (resolve, reject) {
  resolve(100)
  // reject(new Error('promise rejected'))
})

promise.then(function (value) {
  console.log(value)
}, function (error) {
  console.log("error:", error)
})

// const promise = new Promise((resolve, reject) => {
//   console.log(1)
//   resolve()
//   console.log(2)
// })

// promise.then(() => {
//   console.log(3)
// })

// console.log(4)